<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>水平垂直居中-浮动方法</title>
        <style type="text/css">             
            .table {
                border: 1px solid orange;
                display: table;
                height: 200px;
                width: 200px;
                text-align: center;
            }
            .tableCell {
                display: table-cell;
                vertical-align: middle;
            }
        </style>
        <!--[if lte ie 7]>
            <style type="text/css">
                .tableCell {
                    display: inline-block;
                }


                b {
                    display: inline-block;
                    height: 100%;
                    vertical-align: middle;
                    width: 1px;
                }
            </style>
        <![endif]-->
    </head>
    <body>
        <p class="table">
            <span class="tableCell">Centering multiple lines <br>in a block container.</span>
            <!--[if lte IE 7]><b></b><![endif]-->
        </p>
    </body>
</html>